﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="MyImages.aspx.vb" Inherits="HauntedNetworkingSite.MyImages" %>

<%@ Register src="Banner.ascx" tagname="Banner" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <uc1:Banner ID="Banner1" runat="server" />
    
    </div>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <table class="style1">
        <tr>
            <td align="center">
            <asp:ListView ID="ListView1" runat="server" DataSourceID="MyImagesDataSource" 
        style="margin-right: 0px">
        <ItemTemplate>
            <asp:ImageButton ID="ImageButton1" runat="server" Height="150px" 
                ImageAlign="Middle" ImageUrl='<%# Eval("Picture") %>' 
                PostBackUrl='<%# Eval("ID", "FullSizeImage.aspx?ID={0}") %>' 
                Width="200px" />
            <br />
            &nbsp;<asp:Label ID="PictureNameLabel" runat="server" 
                Text='<%# Eval("PictureName") %>'></asp:Label>
            <br />
            <br />
        </ItemTemplate>
        <EmptyDataTemplate>
            <span>
            <br />
            You haven&#39;t uploaded any images yet.<br />
            <br />
            </span>
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/AddImages.aspx">Click 
            here to upload</asp:HyperLink>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <span style="">Picture:
            <asp:TextBox ID="PictureTextBox" runat="server" Text='<%# Bind("Picture") %>' />
            <br />
            PictureName:
            <asp:TextBox ID="PictureNameTextBox" runat="server" 
                Text='<%# Bind("PictureName") %>' />
            <br />
            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                Text="Insert" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Clear" />
            <br />
            <br />
            </span>
        </InsertItemTemplate>
        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span style="">&nbsp;<span style=""><span ID="itemPlaceholder" runat="server"></span> </span></span>
            </div>
            <div style="">
                <asp:DataPager ID="DataPager1" runat="server">
                    <Fields>
                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                            ShowNextPageButton="False" ShowPreviousPageButton="False" />
                        <asp:NumericPagerField />
                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                            ShowNextPageButton="False" ShowPreviousPageButton="False" />
                    </Fields>
                </asp:DataPager>
            </div>
        </LayoutTemplate>
        <EditItemTemplate>
            <span style="">Picture:
            <asp:TextBox ID="PictureTextBox" runat="server" Text='<%# Bind("Picture") %>' />
            <br />
            PictureName:
            <asp:TextBox ID="PictureNameTextBox" runat="server" 
                Text='<%# Bind("PictureName") %>' />
            <br />
            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                Text="Update" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Cancel" />
            <br />
            <br />
            </span>
        </EditItemTemplate>
        <SelectedItemTemplate>
            <span style="">Picture:
            <asp:Label ID="PictureLabel" runat="server" Text='<%# Eval("Picture") %>' />
            <br />
            PictureName:
            <asp:Label ID="PictureNameLabel" runat="server" 
                Text='<%# Eval("PictureName") %>' />
            <br />
            <br />
            </span>
        </SelectedItemTemplate>
    </asp:ListView>
                &nbsp;</td>
        </tr>
    </table>
        
    
    <p>
        <asp:SqlDataSource ID="MyImagesDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
            
            
            SelectCommand="SELECT [Picture], [PictureName], [ID] FROM [UserUploadedImages] WHERE ([UserName] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="UserName" QueryStringField="UserName" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    </form>
</body>
</html>
